package com.teamclub.erp.scontrollers

import javax.servlet.http.HttpServletRequest
import com.teamclub.erp.sforms.DealerInfoLinkForm
import com.teamclub.erp.sservices.DealerInfoLinkService
import com.teamclub.util.libs.Eithers
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.{PostMapping, RequestBody, RequestMapping, RestController}

/**
  * Created by ilkkzm on 17-9-17.
  */
@RestController("com.teamclub.erp.scontrollers.DealerInfoLinkController")
@RequestMapping(Array("/erp"))
class DealerInfoLinkController {
  @Autowired
  var dealerInfoService: DealerInfoLinkService = _

  @PostMapping(Array("/dealerinfolink/list"))
  def list(@RequestBody form: DealerInfoLinkForm) = {
    Eithers.toJson(dealerInfoService.list(form))
  }
  @PostMapping(Array("/dealerinfolink/add"))
  def add(@RequestBody form: DealerInfoLinkForm) = {
    Eithers.toJson(dealerInfoService.add(form))
  }
  @PostMapping(Array("/dealerinfolink/del"))
  def del(@RequestBody form:DealerInfoLinkForm) = {
    Eithers.toJson(dealerInfoService.del(form))
  }
  @PostMapping(Array(""))
  def menusync(@RequestBody form: DealerInfoLinkForm) = ???
  @PostMapping(Array("/dealerinfo/judgeIsDealer"))
  def judgeIsDealer(@RequestBody form: DealerInfoLinkForm) = {
    Eithers.toJson(dealerInfoService.judgeIsDealer(form))
  }
}
